<link rel="stylesheet" href="/static/css/bootstrap/bootstrap.min.css" />
<div class="content">

    <div style="margin:20px auto; width:80%;text-align:center;">
        <form action="{:url('manager/user/addroleing')}"  method="post">
            <input type="hidden" name="id" value="{$userinfo.id}" >
            <div class="form-group">用户ID<span style="background-color: #b2beb5;color:white">&nbsp;<b>{$userinfo.id}</b></span></div>
            <div class="form-group">用户名：<input type="text" name="username" value="{$userinfo.username}" ></div><br />
            <div class="form-group">用户角色：<span><input  type="checkbox" name="admin[]" id="sad" value="1"> &nbsp;超级管理员</span>|<span><input type="checkbox" id="ad" name="admin[]" value="2"/>&nbsp;管理员</span> </div>
            <div class="form-group"><input type="submit" value="提交" id = "submit1"  ></div>
        </form>
    </div>
</div>
<script type="text/javascript">
    var checked = [];
    var sad = document.getElementById('sad');
    var ad = document.getElementById('ad');
    if({$count}==1){
        checked[0] = {$checked[0]['id_role']};
        if(checked[0]==1){
            sad.checked = true;
        }else{
            ad.checked = true;
        }
    }
    if({$count}==2){
            sad.checked = true;
            ad.checked = true;
    }
</script>
